package com.itheima.workone1111;

public class Manager extends Employee {
    //成员属性
    private Clerk clerk;

    // 空参构造方法
    public Manager() {
    }

    // 满参构造方法
    public Manager(String name, String workId, String dept, Clerk clerk) {
        super(name, workId, dept);
        this.clerk = clerk;
    }

    // Getter 和 Setter 方法
    public Clerk getClerk() {
        return clerk;
    }

    public void setClerk(Clerk clerk) {
        this.clerk = clerk;
    }

    @Override
    public void showMsg() {
        System.out.println("经理：");
        System.out.println("姓名为: " + getName());
        System.out.println("工号为: " + getWorkId());
        System.out.println("部门为: " + getDept());
        if (clerk != null) {
            System.out.println("他的职员是: " + clerk.getName());
        }
    }

}
